package com.lyl.exception;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class ExceptionMain {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ExceptionMain.class, args);
        Environment environment = context.getBean(Environment.class);
        String port = environment.getProperty("server.port");
        port = port == null ? "8080" : port;
        System.out.println("访问链接：http://localhost:" + port);
    }
}
